package io.zhengsh.vvip.leetcode.hash;

public class Q53 {

    class Solution {
        public int maxSubArray(int[] nums) {
            int temp = 0, maxSum = nums[0];
            for (int i = 0; i < nums.length; i++) {
                temp = Math.max(temp + nums[i], nums[i]);
                maxSum = Math.max(maxSum, temp);
            }
            return maxSum;
        }
    }
}
